package com.neu.yth.nepBackend.aqi.service.impl;


import com.neu.yth.nepBackend.aqi.mapper.AqiMapper;
import com.neu.yth.nepBackend.aqi.service.IAqiService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.neu.yth.nepBackend.entity.Aqi;
import com.neu.yth.nepBackend.enums.ResponseEnum;
import com.neu.yth.nepBackend.utils.Result;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 空气质量指数级别表 服务实现类
 * </p>
 *
 * @author YTH
 * @since 2024-05-31
 */
@Service
public class AqiServiceImpl extends ServiceImpl<AqiMapper, Aqi> implements IAqiService {

    /**
     * 查询所有
     *
     * @return
     */
    @Override
    public Result selectAll() {
        List<Aqi> list = this.list();
        if (list==null){
            return Result.fail(ResponseEnum.RESULT_IS_EMPTY);
        }
        return Result.success(list);
    }
}
